Method and apparatus for improved weighting filters in a CELP encoder

ABSTRACT

A method of speech encoding comprises generating a first synthesized speech signal from a first excitation signal, weighting the first synthesized speech signal using a first error weighting filter to generate a first weighted speech signal, generating a second synthesized speech signal from a second excitation signal, weighting the second synthesized speech signal using a second error weighting filter to generate a second weighted speech signal, and generating an error signal using the first weighted speech signal and the second weighted speech signal, wherein the first error weighting filter is different from the second error weighting filter. The method may further generate the error signal by weighting the speech signal using a third error weighting filter to generate a third weighted speech signal, and subtracting the first weighted speech signal and the second weighted speech signal from the third weighted speech signal to generate the error signal.

This application is a continuation of U.S. application Ser. No.09/625,088, filed Jul. 25, 2000 now U.S. Pat. No. 7,013,268.

FIELD OF THE INVENTION

The present invention relates generally to digital voice encoding and,more particularly, to a method and apparatus for improved weightingfilters in a CELP encoder.

BACKGROUND OF THE INVENTION

A general diagram of a CELP encoder 100 is shown in FIG. 1A. A CELPencoder uses a model of the human vocal tract to reproduce a speechinput signal. The parameters for the model are actually extracted fromthe speech signal being reproduced, and it is these parameters that aresent to a decoder 114, which is illustrated in FIG. 1B. Decoder 114 usesthe parameters to reproduce the speech signal. Referring to FIG. 1A,synthesis filter 104 is a linear predictive filter and serves as thevocal tract model for CELP encoder 100. Synthesis filter 114 takes aninput excitation signal μ(n) and synthesizes a speech signal s′(n) bymodeling the correlations introduced into speech by the vocal tract andapplying them to the excitation signal μ(n).

In CELP encoder 100 speech is broken up into frames, usually 20 ms each,and parameters for synthesis filter 104 are determined for each frame.Once the parameters are determined, an excitation signal μ(n) is chosenfor that frame. The excitation signal is then synthesized, producing asynthesized speech signal s′(n). The synthesized frame s′(n) is thencompared to the actual speech input frame s(n) and a difference or errorsignal e(n) is generated by subtractor 106. The subtraction function istypically accomplished via an adder or similar functional component asthose skilled in the art will be aware. Actually, excitation signal μ(n)is generated from a predetermined set of possible signals by excitationgenerator 102. In CELP encoder 100, all possible signals in thepredetermined set are tried in order to find the one that produces thesmallest error signal e(n). Once this particular excitation signal μ(n)is found, the signal and the corresponding filter parameters are sent todecoder 112, which reproduces the synthesized speech signal s′(n).Signal s′(n) is reproduced in decoder 112 using an excitation signalμ(n), as generated by decoder excitation generator 114, and synthesizingit using decoder synthesis filter 116.

By choosing the excitation signal that produces the smallest errorsignal e(n), a very good approximation of speech input s(n) can bereproduced in decoder 112. The spectrum of error signal e(n), however,will be very flat, as illustrated by curve 204 in FIG. 2. The flatnesscan create problems in that the signal-to-noise ratio (SNR), with regardto synthesized speech signal s′(n) (curve 202), may become too small foreffective reproduction of speech signal s(n). This problem is especiallyprevalent in the higher frequencies where, as illustrated in FIG. 2,there is typically less energy in the spectrum of s′(n). In order tocombat this problem, CELP encoder 100 includes a feedback path thatincorporates error weighting filter 108. The function of error weightingfilter 108 is to shape the spectrum of error signal e(n) so that thenoise spectrum is concentrated in areas of high voice content. Ineffect, the shape of the noise spectrum associated with the weightederror signal e_(w)(n) tracks the spectrum of the synthesized speechsignal s(n), as illustrated in FIG. 2 by curve 206. In this manner, theSNR is improved and the quality of the reproduced speech is increased.

The weighted error signal e_(w)(n) is also used to minimize the errorsignal by controlling the generation of excitation signal μ(n) In fact,signal e_(w)(n) actually controls the selection of signal μ(n) and thegain associated with signal μ(n). In general, it is desirable that theenergy associated with s′(n) be as stable or constant as possible.Energy stability is controlled by the gain associated with μ(n) andrequires a less aggressive weighting filter 108. At the same time,however, it is desirable that the excitation spectrum (curve 202) ofsignal s′(n) be as flat as possible. Maintaining this flatness requiresan aggressive weighting filter 108. These two requirements are directlyat odds with each other, because the generation of excitation signalμ(n) is controlled by one weighting filter 108. Therefore, a trade-offmust be made that results in lower performance with regard to one aspector the other.

SUMMARY OF THE INVENTION

There is provided a speech encoder comprising a first weighting meansfor performing an error weighting on a speech input. The first weightingmeans is configured to reduce an error signal resulting from adifference between a first synthesized speech signal and the speechinput. In addition, the speech encoder includes a means for generatingthe first synthesized speech signal from a first excitation signal, anda second weighting means for performing an error weighting on the firstsynthesized speech signal. The second weighting means is also configuredto reduce the error signal resulting from the difference between thespeech input and the first synthesized speech signal. There is alsoincluded a first difference means for taking the difference between thefirst synthesized speech signal and the speech input, where the firstdifference means is configured to produce a first weighted error signal.The speech encoder also includes a means for generating a secondsynthesized speech signal from a second excitation signal, and a thirdweighting means for performing an error weighting on the secondsynthesized speech signal. The third weighting means is configured toreduce a second error signal resulting from the difference between thefirst weighted error signal and the second synthesized speech signal.Then there is included a second difference means for taking thedifference between the second synthesized speech signal and the firsterror signal, where the second difference means is configured to producea second weighted error signal. Finally, there is included a feedbackmeans for using the second weighted error signal to control theselection of the first excitation signal, and the selection of thesecond excitation signal.

There is also provided a transmitter that includes a speech encoder suchas the one described above and a method for speech encoding. These andother embodiments as well as further features and advantages of theinvention are described in detail below.

BRIEF DESCRIPTION OF THE DRAWINGS

In the figures of the accompanying drawings, like reference numberscorrespond to like elements, in which:

FIG. 1A is a block diagram illustrating a CELP encoder.

FIG. 1B is a block diagram illustrating a decoder that works inconjunction with the encoder of FIG. 1A.

FIG. 2 is a graph illustrating the signal to noise ratio of asynthesized speech signal and a weighted error signal in the encoderillustrated in FIG. 1A.

FIG. 3 is a second block diagram of a CELP encoder.

FIG. 4 is a block diagram illustrating one embodiment of a speechencoder in accordance with the invention.

FIG. 5 is a graph illustrating the pitch of a speech signal.

FIG. 6 is a block diagram of a second embodiment of a speech encoder inaccordance with the invention.

FIG. 7A is a diagram illustrating the concentration of energy of thespeech signal in the low frequency portion of the spectrum.

FIG. 7B is a diagram illustrating the concentration of energy of thespeech signal in the high frequency portion of the spectrum.

FIG. 8 is a block diagram, illustrating a transmitter that includes aspeech encoder such as the speech encoder illustrated in FIG. 4 or FIG.6.

FIG. 9 is a process flow diagram illustrating a method of speechencoding such in accordance with the invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

A typical implementation of a CELP encoder is illustrated in FIG. 3.Generally, excitation signal μ(n) is generated from a large vectorquantizer codebook such as codebook 302 in encoder 300. Multiplier 308multiplies the signal selected from codebook 302 by gain term (g_(c)) inorder to control the power of excitation signal μ(n). Excitation signalμ(n) is then passed through synthesis filter 312, which is typically ofthe following form:H(z)=I/A(z)   (1)WhereA(z)=1−Σ_(i=1) ^(P)α_(i)z⁻¹

Equation (2) represents a prediction error filter determined byminimizing the energy of a residual signal produced when the originalsignal is passed through synthesis filter 312. Synthesis filter 312 isdesigned to model the vocal tract by applying the correlation normallyintroduced into speech by the vocal tract to excitation signal μ(n). Theresult of passing excitation signal μ(n) through synthesis filter 312 issynthesized speech signal s′(n).

Synthesized speech signal s′(n) is passed through error weighting filter314, producing weighted synthesized speech signal s′_(w)(n). Speechinput s(n) is also passed through an error weighting filter 318,producing weighted speech signal s_(w)(n). Weighted synthesized speechsignal s′_(w)(n) is subtracted from weighted speech signal s_(w)(n),which produces an error signal. The function of the error weightingfilters 314 and 318 is to shape the spectrum of the error signal so thatthe noise spectrum of the error signal is concentrated in areas of highvoice content. Therefore, the error signal generated by subtractor 316is actually a weighted error signal e_(w)(n).

Weighted error signal e_(w)(n) is feedback to control the selection ofthe next excitation signal from codebook 302 and also to control thegain term (g_(c)) applied thereto. Without the feedback, every entry incodebook 302 would need to be passed through synthesis filter 302 andsubtractor 316 to find the entry that produced the smallest errorsignal. But by using error weighting filters 314 and 318 and feedingweighted error signal e_(w)(n) back, the selection process can bestreamlined and the correct entry found much quicker.

Codebook 302 is used to track the short term variations in speech signals(n); however, speech is characterized by long-term periodicities thatare actually very important to effective reproduction of speech signals(n). To take advantage of these long-term periodicities, an adaptivecodebook 304 may be included so that the excitation signal μ(n) willinclude a component of the form Gμ(n−α), where α is the estimated pitchperiod. Pitch is the term used to describe the long-term periodicity.The adaptive codebook selection is multiplied by gain factor (g_(p)) inmultiplier 306. The selection from adaptive codebook 304 and theselection from codebook 302 are then combined in adder 310 to createexcitation signal μ(n). As an alternative to including the adaptivecodebook, synthesis filter 312 may include a pitch filter to model thelong-term periodicity present in the voiced speech.

In order to address the problem of balancing energy stability andexcitation spectrum flatness, the invention uses the approachillustrated in FIG. 4. Encoder 400, in FIG. 4, uses parallel signalpaths for an excitation signal μ₁(n), from adaptive codebook 402, andfor an excitation signal μ₂(n) from fixed codebook 404. Each excitationsignal μ₁(n) and μ₂(n) are multiplied by independent gain terms (g_(p))and (g_(c)) respectively. Independent synthesis filters 410 and 412generate synthesized speech signals s′₁(n) and s′₂(n) from excitationsignals μ₁(n) and μ₂(n) and independent error weighting filters 414 and416 generate weighted synthesized speech signals s′_(w1)(n) ands′_(w2)(n), respectively.

Weighted synthesized speech signal s′_(w1)(n) is subtracted insubtractor 420 from weighted speech signal s_(w)(n), which is generatedfrom speech signal s(n) by error weighting filter 418. Weightedsynthesized speech signals s′_(w2)(n) is subtracted from the output ofsubtractor 420 in subtractor 422, thus generating weighted error signale_(w)(n). Therefore, weighted error signal e_(w)(n) is formed inaccordance with the following equation:e_(w)(n)=s_(w)(n)−s′_(w1)(n⁾⁻s′_(w2)(n)   (3)

which is the same as:e_(w)(n₎=s_(w)(n)−(s′_(w1)(n)+s′_(w2)(n))   (4)

Equation (4) is essentially the same as the equation for e_(w)(n) inencoder 300 of FIG. 3. But in encoder 400, the error weighting and gainterms applied to the selections from the codebooks are independent andcan either be independently controlled through feedback or independentlyinitialized. In fact, weighted error signal e_(w)(n) in encoder 400 isused to independently control the selection from fixed codebook 404 andthe gain (g_(c)) applied thereto, and the selection from a adaptivecodebook 402 and the gain (g_(p)) applied thereto.

Additionally, different error weighting can be used for each errorweighting filter 414, 416, and 418. In order to determine the bestparameters for each error weighting filter 414, 416 and 418, differentparameters are tested with different types of speech input sources. Forexample, the speech input source may be a microphone or a telephoneline, such as a telephone line used for an Internet connection. Thespeech input can, therefore, vary from very noisy to relatively calm. Aset of optimum error weighting parameters for each type of input isdetermined by the testing. The type of input used in encoder 400 is thenthe determining factor for selecting the appropriate set of parametersto be used for error weighting filters 414, 416, and 418. The selectionof optimum error weighting parameters combined with independent controlof the codebook selections and gains applied thereto, allows foreffective balancing of energy stability and excitation spectrumflatness. Thus, the performance of encoder 400 is improved with regardto both.

Getting the pitch correct for speech input s(n) is also very important.If the pitch is not correct then the long-term periodicity will not becorrect and the reproduced speech will not sound good. Therefore, apitch estimator 424 may be incorporated into encoder 400. In oneimplementation, pitch estimator 424 generates a speech pitch estimates_(p)(n), which is used to further control the selection from adaptivecodebook 402. This further control is designed to ensure that thelong-term periodicity of speech input s(n) is correctly replicated inthe selections from adaptive codebook 402.

The importance of the pitch is best illustrated by the graph in FIG. 5,which illustrates a speech sample 502. As can be seen, the short-termvariation in the speech signal can change drastically from point topoint along speech sample 502. But the long-term variation tends to bevery periodic. The period of speech sample 502 is denoted as (T) in FIG.5. Period (T) represents the pitch of speech sample 502; therefore, ifthe pitch is not estimated accurately, then the reproduced speech signalmay not sound like the original speech signal.

In order to improve the speech pitch estimation s_(p)(n) encoder 600 ofFIG. 6 includes an additional filter 602. Filter 602 generates afiltered weighted speech signal s″_(w)(n), which is used by pitchestimator 424, from weighted speech signal s_(w)(n). In a typicalimplementation, filter 602 is a low pass filter (LPF). This is becausethe low frequency portion of speech input s(n) will be more periodicthan the high frequency portion. Therefore, filter 602 will allow pitchestimator 424 to make a more accurate pitch estimation by emphasizingthe periodicity of speech input s(n).

In an alternative implementation of encoder 600, filter 602 is anadaptive filter. Therefore, as illustrated in FIG. 7A, when the energyin speech input s(n) is concentrated in the low frequency portion of thespectrum, very little or no filtering is applied by filter 602. This isbecause the low frequency portion and thus the periodicity of speechinput s(n) is already emphasized. If, however, the energy in speechinput s(n) is concentrated in the higher frequency portion of thespectrum (FIG. 7B), then a more aggressive low pass filtering is appliedby filter 602. By varying the degree of filtering applied by filter 602according to the energy concentration of speech input s(n), a moreoptimized speech input estimation s_(p)(n) is maintained.

As shown in FIG. 6, the input to filter 602 is speech input s(n). Inthis case, filter 602 will incorporate a fourth error weighting filterto perform error weighting on speech input s(n). This configurationenables the added flexibility of making the error weighting filterincorporated in filter 602 different from error weighting filter 418, inparticular, as well as from filters 414 and 416. Therefore, theimplementation illustrated in FIG. 6 allows for each of four errorweighting filters to be independently configured so as to provide theoptimum error weighting of each of the four input signals. The result isa highly optimized estimation of speech input s(n).

Alternatively, filter 602 may take its input from the output of errorweighting filter 418. In this case, error weighting filter 418 providesthe error weighting for s″w(n), and filter 602 does not incorporate afourth error weighting filter. This implementation is illustrated by thedashed line in FIG. 6. This implementation may be used when differenterror weighting for s″w(n) and sw(n) is not required. The resultingimplementation of filter 602 only incorporates the LDF function and iseasier to design and implement relative to the previous implementation.

There is also provided a transmitter 800 as illustrated in FIG. 8.Transmitter 800 comprises a voice input means 802, which is typically amicrophone. Speech input means 802 is coupled to a speech encoder 804,which encodes speech input provided by speech input means 802 fortransmission by transmitter 800. Speech encoder 804 is an encoder suchas encoder 400 or encoder 600 as illustrated in FIG. 4 and FIG. 6,respectively. As such, the encoded data generated by speech encoder 804comprises information relating to the selection for codebooks 402 and404 and for gain terms (g_(p)) and (g_(c)), as well as parameters forsynthesis filters 410 and 412. A device, which receives the transmissionfrom transmitter 800, will use these parameters to reproduce the speechinput provided by speech input means 802. For example, such a device mayinclude a decoder as described in U.S. patent application Ser. No.09/624,187, filed Jul. 25, 2000, now U.S. Pat. No. 6,466,904, titled“Method and Apparatus Using Harmonic Modeling in an Improved SpeechDecoder,” which is incorporated herein by reference in its entirety.

Speech encoder 804 is coupled to a transceiver 806, which converts theencoded data from speech encoder 804 into a signal that can betransmitted. For example, many implementations of transmitter 800 willinclude an antenna 810. In this case, transceiver 806 will convert thedata from speech encoder 804 into an RF signal for transmission viaantenna 810. Other implementations, however, will have a fixed lineinterface such as a telephone interface 808. Telephone interface 808 maybe an interface to a PSTN or ISDN line, for example, and may beaccomplished via a coaxial cable connection, a regular telephone line,or the like. In a typical implementation, telephone interface 808 isused for connecting to the Internet.

Transceiver 806 will typically be interfaced to a decoder as well forbidirectional communication; however, such a decoder is not illustratedin FIG. 8, because it is not particularly relevant to the invention.

Transmitter 800 is capable of implementation in a variety ofcommunication devices. For example, transmitter 800 may, depending onthe implementation, be included in a telephone, a cellular/PCS mobilephone, a cordless phone, a digital answering machine, or a personaldigital assistant.

There is also provided a method of speech encoding comprising the stepsillustrated in FIG. 9. First, in step 902, error weighting is performedon a speech signal. For example, the error weighting may be performed ona speech signal sent by an error weighting filter 418. Then in step 904,a first synthesized speech signal is generated from a first excitationsignal multiplied by a first gain term. For example, s′(n) as generatedfrom μ₁(n) multiplied by gain term (g_(p)) in FIG. 4. In step 906, errorweighting is then performed on the first synthesized speech signal tocreate a weighted first synthesized speech signal, such as s′_(w1)(n)illustrated in FIG. 4. Then, in step 408, a first error signal isgenerated by taking the difference between the weighted speech signaland the weighted first synthesized speech signal.

Next, in step 910, a second synthesized speech signal is generated froma second excitation signal multiplied by a second gain term. Forexample, s′₂(n) as generated in FIG. 4 by multiplying μ₂(n) by (g_(c)).Then, in step 912, error weighting is performed on the secondsynthesized speech signal to create a weighted second synthesized speechsignal, such as s′_(w2)(n) in FIG. 4. In step 914, a second weightederror signal is generated by taking the difference between the firstweighted error signal and the weighted second synthesized speech signal.This second weighted error signal is then used, in step 916, to controlthe generation of subsequent first and second synthesized speechsignals. In other words, the second weighted error signal is used asfeedback to control subsequent values of the second weighted errorsignal. For example, such feedback is illustrated by the feedback ofe_(w)(n) in FIG. 4.

In certain implementations, pitch estimation is performed on the speechsignal as illustrated in FIG. 4 by optional step 918. The pitchestimation is then used to control the generation of at least one of thefirst and second synthesized speech signals. For example, a pitchestimation s_(p)(n) is generated by pitch estimator 424 as illustratedin FIG. 4. Additionally, in some implementations, a filter is used tooptimize the pitch estimation. Therefore, as illustrated by optionalstep 920 in FIG. 4, the speech signal is filtered and a filtered versionof the speech signal is used for the pitch estimation in step 918. Forexample, a filter 602, as illustrated in FIG. 6, may be used to generatea filtered speech signal s″_(w)(n). In certain implementations, thefiltering is adaptive based on the energy spectrum of the speech signal.

While various embodiments of the invention have been presented, itshould be understood that they have been presented by way of exampleonly and not limitation. It will be apparent to those skilled in the artthat many other embodiments are possible, which would not depart fromthe scope of the invention. For example, in addition to being applicablein an encoder of the type described, those skilled in the art willunderstand that there are several types of analysis-by-synthesis methodsand that the invention would be equally applicable in encodersimplementing these methods.

1. A method of speech encoding comprising: generating a firstsynthesized speech signal from a first excitation signal; weighting saidfirst synthesized speech signal using a first error weighting filter togenerate a first weighted speech signal; generating a second synthesizedspeech signal from a second excitation signal; weighting said secondsynthesized speech signal using a second error weighting filter togenerate a second weighted speech signal; and generating an error signalusing said first weighted speech signal and said second weighted speechsignal; wherein said first error weighting filter is different from saidsecond error weighting filter.
 2. The method of claim 1, wherein saidgenerating said error signal further comprises: weighting said speechsignal using a third error weighting filter to generate a third weightedspeech signal; and subtracting said first weighted speech signal andsaid second weighted speech signal from said third weighted speechsignal to generate said error signal.
 3. The method of claim 2, whereinsaid third error weighting filter is independent from and the same assaid first error weighting filter.
 4. The method of claim 1, whereinsaid first excitation signal is from a first codebook and said secondexcitation signal is from a second codebook, said method furthercomprising: using said error signal to independently select a thirdexcitation signal from said first codebook and a fourth excitationsignal from said second codebook; and using said error signal toindependently select a third gain to apply to said third excitationsignal and a fourth gain to apply to said fourth excitation signal. 5.The method of claim 1, wherein said generating said first synthesizedspeech signal uses a first synthesizer and said generating said secondsynthesized speech signal uses a second synthesizer, and wherein saidfirst synthesizer is independent from said second synthesizer.
 6. Themethod of claim 5, wherein said first synthesizer is the same as saidsecond synthesizer.
 7. A speech encoder comprising: a first codebook; asecond codebook; a speech synthesizer configured to generate a firstsynthesized speech signal from a first excitation signal of said firstcodebook and to generate a second synthesized speech signal from asecond excitation signal of said second codebook; a first errorweighting filter configured to generate a first weighted speech signalfrom said first synthesized speech signal; a second error weightingfilter configured to generate a second weighted speech signal from saidsecond synthesized speech signal; and an error signal generatorconfigured to generate an error signal using said first weighted speechsignal and said second weighted speech signal; wherein said first errorweighting filter is different from said second error weighting filter.8. The speech encoder of claim 7, wherein said speech synthesizerincludes a first speech synthesizer for generating said firstsynthesized speech signal and a second speech synthesizer for generatingsaid second synthesized speech signal.
 9. The speech encoder of claim 7further comprising a third error weighting filter to generate a thirdweighted speech signal from said speech signal, wherein said errorsignal generator includes a signal subtractor configured to subtractsaid first weighted speech signal and said second weighted speech signalfrom said third weighted speech signal to generate said error signal.10. The speech encoder of claim 9, wherein said third error weightingfilter is independent from and the same as said first error weightingfilter.
 11. The speech encoder of claim 7, wherein said speech encoderuses said error signal to independently select a third excitation signalfrom said first codebook and a fourth excitation signal from said secondcodebook, and to independently select a third gain to apply to saidthird excitation signal and a fourth gain to apply to said fourthexcitation signal.
 12. A speech encoder comprising: means for generatinga first synthesized speech signal from a first excitation signal; meansfor weighting said first synthesized speech signal to generate a firstweighted speech signal; means for generating a second synthesized speechsignal from a second excitation signal; means for weighting said secondsynthesized speech signal to generate a second weighted speech signal;and means for generating an error signal using said first weightedspeech signal and said second weighted speech signal; wherein said meansfor weighting said first synthesized speech signal is different fromsaid means for weighting said second synthesized speech signal.
 13. Thespeech encoder of claim 12 farther comprising: means for weighting saidspeech signal to generate a third weighted speech signal; and means forsubtracting said first weighted speech signal and said second weightedspeech signal from said third weighted speech signal to generate saiderror signal.
 14. The speech encoder of claim 13, wherein means forweighting said speech signal is independent from and the same as saidmeans for weighting said first synthesized speech signal.
 15. The speechencoder of claim 12, wherein said first excitation signal is from afirst codebook and said second excitation signal is from a secondcodebook, said speech encoder further comprising means for using saiderror signal to independently select a third excitation signal from saidfirst codebook and a fourth excitation signal from said second codebook,and means for using said error signal to independently select a thirdgain to apply to said third excitation signal and a fourth gain to applyto said fourth excitation signal.
 16. The speech encoder of claim 12,wherein said means for generating said first synthesized speech signalis independent from said means for generating said second synthesizedspeech signal.
 17. The speech encoder of claim 16, said means forgenerating said first synthesized speech signal is the same as saidmeans for generating said second synthesized speech signal.
 18. A methodof encoding a speech signal for use by a device, the method comprising:performing, by the device, a first error weighting of the speech signalto generate a weighted speech signal; generating, by the device, a firstsynthesized speech signal from a first excitation signal; performing, bythe device, a second error weighting of the first synthesized speechsignal to generate a first weighted synthesized speech signal;generating, by the device, a second synthesized speech signal from asecond excitation signal; performing, by the device, a third errorweighting on the second synthesized speech signal to generate a secondweighted synthesized speech signal; and wherein the third errorweighting is different from the second error weighting.
 19. The methodof claim 18 further comprising: generating a first error signal as adifference between the weighted speech signal and the first weightedsynthesized speech signal.
 20. The method of claim 19, wherein the firstexcitation signal is from the first codebook and the second excitationsignal is from a second codebook, the method further comprising: usingthe first error signal to independently select a third excitation signalfrom the first codebook and a fourth excitation signal from the secondcodebook; and using the first error signal to independently select athird gain to apply to the third excitation signal and a fourth gain toapply to the fourth excitation signal.
 21. The method of claim 18,wherein the device is a communication device.
 22. The method of claim18, wherein the device is one of a telephone, a mobile phone, a cordlessphone, a digital answering machine or a personal digital assistant. 23.The speech encoder of claim 7, wherein the speech encoder is included ina device.
 24. The speech encoder of claim 23, wherein the device is acommunication device.
 25. The speech encoder of claim 23, wherein thedevice is one of a telephone, a mobile phone, a cordless phone, adigital answering machine or a personal digital assistant.
 26. Themethod of claim 1, wherein the method of speech encoding is performed bya device.
 27. The method of claim 26, wherein the device is acommunication device.
 28. The method of claim 26, wherein the device isone of a telephone, a mobile phone, a cordless phone, a digitalanswering machine or a personal digital assistant.
 29. A devicecomprising: a speech encoder configured to: perform a first errorweighting of the speech signal to generate a weighted speech signal;generate a first synthesized speech signal from a first excitationsignal; perform a second error weighting of the first synthesized speechsignal to generate a first weighted synthesized speech signal; generatea second synthesized speech signal from a second excitation signal;perform a third error weighting on the second synthesized speech signalto generate a second weighted synthesized speech signal; and wherein thethird error weighting is different from the second error weighting. 30.The device of claim 29, wherein the speech encoder is further configuredto generate a first error signal as a difference between the weightedspeech signal and the first weighted synthesized speech signal.
 31. Thedevice of claim 30, wherein the first excitation signal is from thefirst codebook and the second excitation signal is from a secondcodebook, and wherein the speech encoder is further configured to: Usethe first error signal to independently select a third excitation signalfrom the first codebook and a fourth excitation signal from the secondcodebook; and Use the first error signal to independently select a thirdgain to apply to the third excitation signal and a fourth gain to applyto the fourth excitation signal.
 32. The device of claim 29, wherein thedevice is a communication device.
 33. The device of claim 29, whereinthe device is one of a telephone, a mobile phone, a cordless phone, adigital answering machine or a personal digital assistant.